<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>旋转</title>

    <style>
        .item {
            width: 100px;
            height: 50px;
            background-color: yellow;
            position: absolute;
            top: 0;
            /* 平移  */
            margin: 0 auto;
            /* 过渡 所有的css变化都会使用这个过渡效果 */
            transition: all 1s linear 0s;
            text-align: center;
            line-height: 50px;
        }

        .box {
            width: 80%;
            margin: 0 auto;
            position: relative;
        }

        .item:nth-of-type(2):hover {
            transform: translateY(-25px) rotateX(90deg);
        }

        .item:nth-of-type(2) {
            background-color: pink;
            position: absolute;
            top: 0;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="item">张一健</div>
        <div class="item">李国伟</div>
    </div>
</body>
</html>